Class symantec.itools.awt.shape.Line
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.shape.Line

Object
   |
   +----Component
           |
           +----symantec.itools.awt.shape.Line

public class Line
extends Component
Implements a line than can have a thickness.

Version:
1.1, July 30, 1997
Author:
Symantec

Variable Index

 o lineThickness
The thickness of the line to draw.
 o poly
The polygon that defines the line when lineThickness is larger than 1.
 o slopeType
The slope type of the line to be drawn (either positive (true) or negative (false)).

Constructor Index

 o symantec.itools.awt.shape.Line()
Constructs a default Line with positive slope and thickness of 1 pixel.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all property change events.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener for all vetoable property change events.
 o contains(int, int)
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.
 o getLineThickness()
Gets the thickness of the line to draw.
 o getMinimumSize()
Returns the minimum dimensions to properly display this component.
 o getPreferredSize()
Returns the recommended dimensions to properly display this component.
 o isPositiveSlope()
Gets the slope type of the line to draw.
 o paint(Graphics)
Paints the line using the given graphics context.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all property change events.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener for all vetoable property change events.
 o setLineThickness(int)
Sets the thikcness of the line to draw.
 o setPositiveSlope(boolean)
Sets the slope type of the line to draw.

Variables

 o lineThickness
protected int lineThickness
The thickness of the line to draw.

 o poly
protected java.awt.Polygon poly
The polygon that defines the line when lineThickness is larger than 1.

 o slopeType
protected boolean slopeType
The slope type of the line to be drawn (either positive (true) or negative (false)).

Constructors

 o Line
public Line()
Constructs a default Line with positive slope and thickness of 1 pixel.

Methods

 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events.

Parameters:
listener - the listener to add
See Also:
removeVetoableChangeListener
 o contains
public boolean contains(int x,
                        int y)
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.

Parameters:
x - the x coordinate
y - the y coordinate
Overrides:
contains in class Component
See Also:
getComponentAt
 o getLineThickness
public int getLineThickness()
Gets the thickness of the line to draw.

Returns:
the thickness of the line in pixels
See Also:
setLineThickness
 o getMinimumSize
public java.awt.Dimension getMinimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component. Returns the results of a call to getPreferredSize.

Overrides:
getMinimumSize in class Component
See Also:
getPreferredSize
 o getPreferredSize
public java.awt.Dimension getPreferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Returns:
horiziontal and vertical dimensions of 50, 50
Overrides:
getPreferredSize in class Component
See Also:
minimumSize
 o isPositiveSlope
public boolean isPositiveSlope()
Gets the slope type of the line to draw.

Returns:
true if the line will be drawn from the lowwer left corner to the upper right corner. false if the line will be drawn from the upper left corner to the bottom right corner.
See Also:
setPositiveSlope
 o paint
public void paint(Graphics g)
Paints the line using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Component
See Also:
repaint, update
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events.

Parameters:
listener - the listener to remove
See Also:
addVetoableChangeListener
 o setLineThickness
public void setLineThickness(int thickness) throws PropertyVetoException
Sets the thikcness of the line to draw.

Parameters:
thickness - the thickness of the line in pixels
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getLineThickness
 o setPositiveSlope
public void setPositiveSlope(boolean type) throws PropertyVetoException
Sets the slope type of the line to draw.

Parameters:
type - if the type is true the line will be drawn from the lowwer left corner to the upper right corner. If the type is false, the line will be drawn from the upper left corner to the bottom right corner.
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isPositiveSlope

All Packages  Class Hierarchy  This Package  Previous  Next  Index